package fr.softeam.modelio.task.reporting;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.http.client.methods.HttpGet;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

public class DownLoadReportingUtil {
	
	public static List<String> fetchingUrlsFromFile(String filename) throws IOException {
		
		
	    File urlsFile = new File(filename);
		List<String> urls = Files.readLines(urlsFile, Charsets.UTF_8);
		return urls;
	}

	public static HttpGet [] populatesGetRequests (List<String> urls)  {
		HttpGet [] httpGets =new HttpGet[urls.size()] ;
		for(int index=0; index<urls.size(); index++) {
			httpGets[index] = new HttpGet(urls.get(index));		
		}
		return httpGets ;
	}
	
}
